import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/api/serie/list',
    method: 'get',
    params: query
  })
}

export function fetchSerieOptionsList() {
  return request({
    url: '/api/serie/list-all-options',
    method: 'get'
  })
}

export function fetchSerie(id) {
  return request({
    url: '/api/serie/detail',
    method: 'get',
    params: { id }
  })
}

export function createSerie(data) {
  return request({
    url: '/api/serie/create',
    method: 'post',
    data
  })
}

export function updateSerie(data) {
  return request({
    url: '/api/serie/update',
    method: 'post',
    data
  })
}

export function deleteSerie(cateId) {
  return request({
    url: '/api/serie/delete/' + cateId,
    method: 'post'
  })
}

export function fetchSerieVideoList(query) {
  return request({
    url: '/api/serie-video/list',
    method: 'get',
    params: query
  })
}

export function createSerieVideo(data) {
  return request({
    url: '/api/serie-video/create',
    method: 'post',
    data
  })
}

export function updateSerieVideo(data) {
  return request({
    url: '/api/serie-video/update',
    method: 'post',
    data
  })
}

export function deleteSerieVideo(cateId) {
  return request({
    url: '/api/serie-video/delete/' + cateId,
    method: 'post'
  })
}
